﻿@model  TumbaloSoft.Helpers.QueryObjects.BusquedaVenta
@{
	Layout = "~/Views/Shared/_VentasLayout.cshtml";
	ViewBag.Title = "Registrar Venta";
}

<script>
	$(document).ready(function () {
		var id = $("#id");

		function updateTips(t) {
			tips
			    .text(t)
			    .addClass("ui-state-highlight");
			setTimeout(function () {
				tips.removeClass("ui-state-highlight", 1500);
			}, 500);
		}

		$("#dialog-form").dialog({
			autoOpen: false,
			height: 600,
			width: 600,
			modal: true,
			buttons: {
				"Buscar": function () {
					document.getElementById('busqueda').submit()
					$(this).dialog("close");
				},
				Cancelar: function () {
					$(this).dialog("close");
				}
			},
			close: function () {
				allFields.val("").removeClass("ui-state-error");
			}
		});

		$("#buscar")

		    .click(function () {
		    	$("#dialog-form").dialog("open");
		    });
	});

</script>
<!-- content -->
<div class="body2">
	<div class="main">
		<section id="content" style="padding-bottom: 20px;">
			<div class="wrapper">
				<article class="col0">
							<nav class="urbangreymenu">
								<h3 class="headerbar">Inmuebles</h3>
								<ul id="subMenu">
									<li>
										<h5>@Html.ActionLink("Lista de Inmuebles", "Index")</h5>
									</li>
									<li>
										<h5>@Html.ActionLink("Nuevo Inmueble", "Registrar")</h5>
									</li>
								
								</ul>
							</nav>
				</article>
				
				<div id="dialog-form" title="Busqueda de Inmueble">
						<p class="validateTips">Ingrese Los criterios de Busqueda</p>

						<form id="busqueda" method="get" action="/Ventas/RegistrarComprobante">
							<div class="row">
								<span>
									<br>
									Vendedor</span>
								<br>
									<select id="prVendedor-prIdPersona" name="prTipoInmueble.prIdTipoInmueble">
										<option value=0>-Seleccione una Opcion-</option>
										@foreach (var vendedor in ViewBag.listaVendedores)
											{
											<option value="@vendedor.prIdVendedor">@vendedor.prIdVendedor</option>
											}						
									</select>
								
							</div>
							
							
						</form>
				</div>
				
				<article class="col5">
                        <div>&nbsp</div>
                    </article>

				<article class="col1" style="width: 593px">
					<div class="pad1">
						<form id="form_1" method="post" style="height: 100%">
							<h3 class="pad_bot1 pad_top1">Registrar Comprobante</h3>

							<!----BUSCAR VENTA------>
							<div class="row">
								<table style="width: 420px">
									<tr>
										<td style="width: 210px"><span>Venta:</span>
											<a id="buscar">
												<img src="../Content/site/images/icono_buscar.png" style="float: right"></a>
										<td style="width: 210px">
										@Html.TextBoxFor(model => model.prIdVenta, new { @readonly = "readonly", @class = "input", style = "background-color: #b7b3b3" })
										@Html.ValidationMessageFor(model => model.prIdVenta, null)	 </td>
									</tr>
								</table>
							</div>

							<div class="row">
								<table style="width: 420px">
									<tr>
										<td style="width: 210px"><span>Inmueble:</span></td>
										<td style="width: 210px">
											@Html.TextBoxFor(model => model.prInmueble.prDireccion, new { @readonly = "readonly", @class = "input", style = "background-color: #b7b3b3" })
										</td>
									</tr>
								</table>
							</div>


							<div class="row">
								<table style="width: 420px">
									<tr>
										<td style="width: 210px"><span>Propietario*:</span></td>
										<td style="width: 210px">
											@Html.TextBoxFor(model => model.prCliente.prIdPersona, new { @readonly = "readonly", @Value = Session["moneda"], @class = "input", style = "background-color: #b7b3b3" })
										</td>
									</tr>
								</table>
							</div>

							
							<div class="objcentrado" style="margin: 44px 94px 44px 44px; width: 300px;">
								<span>&nbsp;</span>
								<a href="#" class="button" onclick="document.getElementById('form_1').submit()">Registrar</a>
								<a href="#" class="button" onclick="document.getElementById('form_1').reset()">Limpiar</a>
								<a href="..\Ventas\Index" class="button" onclick="document.getElementById('form_1').cancel()">Cancelar</a>
							</div>
						</form>
					</div>
				</article>
			</div>
		</section>
	</div>
</div>

<!-- / content -->

<script type="text/javascript"> Cufon.now(); </script>
